public class TestCase
{
  public static void main (String [] args)
  {
    DoublyLinkedList12 list = new DoublyLinkedList12();

    list.add("This");
    list.add("is");
    list.add("a");
    list.add("list!");
    System.out.println("List size: " + list.size());

    for (Object iter : list)
    {
      System.out.print(((String)iter) + " ");
    }

    System.out.println();
    System.out.println();
    
    list.addToFront("First");
    System.out.println("List size: " + list.size());

    for (Object iter : list)
    {
      System.out.print(((String)iter) + " ");
    }

    System.out.println();
    System.out.println();

    System.out.println("Removed: " + ((String)list.removeFront()));
    System.out.println("List size: " + list.size());

    for (Object iter : list)
    {
      System.out.print(((String)iter) + " ");
    }

    System.out.println();
    System.out.println();

    System.out.println("Removed: " + ((String)list.removeBack()));
    System.out.println("List size: " + list.size());

    for (Object iter : list)
    {
      System.out.print(((String)iter) + " ");
    }

    System.out.println();
    System.out.println();

    list.add("list!");
    System.out.println("List size: " + list.size());

    String str = "This";
    System.out.println("Contains " + str + ": " + list.contains(str));
    System.out.println("Removed: " + list.remove(str));
    System.out.println("List size: " + list.size());
    for (Object iter : list)
    {
      System.out.print(((String)iter) + " ");
    }
    System.out.println();
    System.out.println("Contains " + str + ": " + list.contains(str));

    System.out.println();
    System.out.println();

    str = "list!";
    System.out.println("Contains " + str + ": " + list.contains(str));
    System.out.println("Removed: " + list.remove(str));
    System.out.println("List size: " + list.size());
    for (Object iter : list)
    {
      System.out.print(((String)iter) + " ");
    }
    System.out.println();
    System.out.println("Contains " + str + ": " + list.contains(str));

    System.out.println();
    System.out.println();
    
    list.clear();
    System.out.println("List size: " + list.size());
    for (Object iter : list)
    {
      System.out.print(((String)iter) + " ");
    }

    System.out.println();
    System.out.println();

    list.add("This");
    list.add("is");
    list.add("a");
    list.add("list!");
    System.out.println("List size: " + list.size());

    int size = list.size();
    for (int i = 0; i < size; i++)
    {
      System.out.print(list.get(i) + " ");
    }
    System.out.println();

    list.clear();
    list.add("First");

    System.out.println("List size: " + list.size());
    for (Object iter : list)
    {
      System.out.print(((String)iter) + " ");
    }

    System.out.println();
    System.out.println();

    list.removeFront();

    System.out.println("List size: " + list.size());
    for (Object iter : list)
    {
      System.out.print(((String)iter) + " ");
    }

    System.out.println();
    System.out.println();

    list.clear();

    list.add("First");

    System.out.println("List size: " + list.size());
    for (Object iter : list)
    {
      System.out.print(((String)iter) + " ");
    }

    System.out.println();
    System.out.println();

    list.removeBack();

    System.out.println("List size: " + list.size());
    for (Object iter : list)
    {
      System.out.print(((String)iter) + " ");
    }

    System.out.println();
    System.out.println();
  }
    
}
